package com.firstDay;

import java.util.ArrayList;
import java.util.Collection;

public class Collection_For {
    public static void main(String[] args) {

        Collection list = new ArrayList();

        list.add(new Book("三国演义", "罗贯中", 10.1));
        list.add(new Book("小李飞刀", "古龙", 5.1));
        list.add(new Book("红楼梦", "曹雪芹", 34.61));

        // 增强for
        // 1.使用增强for,在Collection集合
        // 2.增强for,底层仍然是迭代器
        // 3.增强for可以理解成就是简化版本的迭代器遍历
        for (Object obj : list) {
            System.out.println(obj);
        }

    }
}
